<?php

/**
 * Collection of properties which are represent 
 * a table's primary key.
 *
 */
class Junction_Mapping_PrimaryKey implements IteratorAggregate {
	
	private $_properties;
	
	public function __construct() {
		$this->_properties = array();
	}
	
	public function setProperty(Junction_Core_Property $property) {
		$this->_properties[] = $property;
	}
	
	/**
	 * @return Iterator
	 */
	public function getIterator() {
		return new ArrayIterator($this->_properties);
	}
	
	public function isAutoIncrementable(){
		return count($this->_properties) == 1;
	}
}
?>